# -*- coding:utf-8 -*-

import os


basedir = os.path.abspath(os.path.dirname(__file__))

class Config:
	
	SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard hard hard'

	UPLOADED_CAROUSEL_DEST = 'app/static/img/carousel'

	SQLALCHEMY_COMMIT_ON_TEARDOWN = False
	SQLALCHEMY_TRACK_MODIFICATIONS = True

	QINIU_ACCESS_KEY = '6dHr6OavhWfVjOVQZhAekI9cZOgRWpslai4PkqL_'
	QINIU_SECRET_KEY = 'jeBOOgrL-PwvDVv3YalpRQA3oUqc1VEvV7bSZruL'
	QINIU_BUCKET_NAME = 'upload'
	QINIU_DOMAIN = 'http://omdcfjxex.bkt.clouddn.com/'
	
	REDIS_HOST = 'localhost'
	REDIS_PORT = 6379

	CELERY_BROKER_URL = 'redis://' + REDIS_HOST + ':' + str(REDIS_PORT) + '/0'
	CELERY_RESULT_BACKEND = 'redis://' + REDIS_HOST + ':' + str(REDIS_PORT) + '/0'

	ALIDAYU_APP_KEY = '23665958'
	ALIDAYU_SECRET_KEY = 'ef6c18f508f1ac8807efce426fd5745a'
	ALIDAYU_SMSFREESIGNNAME = u'个人二手车网站测'
	ALIDAYU_SMSTYPE = 'normal'
	ALIDAYU_SMSTEMPLATECODE = 'SMS_52380035'

	FRONT_URL = 'http://123.56.119.139:8000'
	
	@staticmethod
	def init_app(app):
		pass

class DevelopmentConfig(Config):
	DEBUG = True
	SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')

config = {
	'development': DevelopmentConfig,

	'default': DevelopmentConfig,
}

